﻿using System;
using System.BusinessObjects.Data;
using Iesi.Collections.Generic;
using Blazing.BusinessObjects.Tagging;

namespace Blazing.BusinessObjects.Assets
{
    [Serializable]
    public class Asset : DataObject<Asset>
    {
        #region Properties

        public virtual int ID
        {
            get { return GetValue<int>("ID"); }
            set
            {
                BeginEdit();
                SetValue("ID", value);
            }
        }

        [NonSerialized]
        AssetType _assetType;
        public virtual AssetType AssetType
        {
            get
            {
                return _assetType;
            }
            set
            {
                BeginEdit();
                _assetType = value;
            }
        }

        public virtual string Name
        {
            get { return GetValue<string>("Name"); }
            set
            {
                BeginEdit();
                SetValue("Name", value);
            }
        }

        public virtual string Description
        {
            get { return GetValue<string>("Description"); }
            set
            {
                BeginEdit();
                SetValue("Description", value);
            }
        }

        public virtual string FilePath
        {
            get { return GetValue<string>("FilePath"); }
            set
            {
                BeginEdit();
                SetValue("FilePath", value);
            }
        }

        public virtual string FileName
        {
            get { return GetValue<string>("FileName"); }
            set
            {
                BeginEdit();
                SetValue("FileName", value);
            }
        }

        [NonSerialized]
        private ISet<TaxonomyTag> _contentpageTaxonomyTags = new HashedSet<TaxonomyTag>();
        public virtual ISet<TaxonomyTag> TaxonomyTags
        {
            get
            {
                return _contentpageTaxonomyTags;
            }
            set
            {
                BeginEdit();
                _contentpageTaxonomyTags = value;
            }
        }

        public virtual DateTime RowStamp
        {
            get { return GetValue<DateTime>("RowStamp"); }
            set
            {
                SetValue("RowStamp", value);
            }
        }

        #endregion
    }
}
